package com.example.mobilesafe.utils;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class Utils {
	public static String getStringFromStream(InputStream is) throws IOException{
		int len;
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		byte[] buffer = new byte[1024];
		String result = null;
		while((len = is.read(buffer)) != -1){
			bos.write(buffer, 0, len);
		}
		result = bos.toString();
		return result;
	}
}
